<template>
	<view class="grid" :class="classArr">
		<slot></slot>
	</view>
</template>

<script>
	import Config from '../../config.js'
	export default {
		props: {
			col: {
				type: String | Number,
				default() {
					return 1
				}
			},
			sq: {
				type: Boolean,
				default() {
					return false
				}
			},
			cls: {
				type: Array,
				default () {
					return []
				}
			}
		},
		data() {
			return {
				
			}
		},
		computed: {
			classArr() {
				let arr = [`col-${this.col}`]
				if (this.cls) {
					arr = arr.concat(this.cls.map(c => Config.classSimple[c] ? Config.classSimple[c] : c))
				}
				if (this.sq) {
					arr = arr.concat([Config.classSimple['sq'], 'sq-item'])
				}
				return arr
			}
		}
	}
</script>

<style lang="scss" scoped>
</style>
